17 research outputs found
Logical relations for coherence of effect subtyping
A coercion semantics of a programming language with subtyping is typically
defined on typing derivations rather than on typing judgments. To avoid
semantic ambiguity, such a semantics is expected to be coherent, i.e.,
independent of the typing derivation for a given typing judgment. In this
article we present heterogeneous, biorthogonal, step-indexed logical relations
for establishing the coherence of coercion semantics of programming languages
with subtyping. To illustrate the effectiveness of the proof method, we develop
a proof of coherence of a type-directed, selective CPS translation from a typed
call-by-value lambda calculus with delimited continuations and control-effect
subtyping. The article is accompanied by a Coq formalization that relies on a
novel shallow embedding of a logic for reasoning about step-indexing
Logical Relations for Coherence of Effect Subtyping
A coercion semantics of a programming language with subtyping is typically defined on typing derivations rather than on typing judgments. To avoid semantic ambiguity, such a semantics is expected to be coherent, i.e., independent of the typing derivation for a given typing judgment. In this article we present heterogeneous, biorthogonal, step-indexed logical relations for establishing the coherence of coercion semantics of programming languages with subtyping. To illustrate the effectiveness of the proof method, we develop a proof of coherence of a type-directed, selective CPS translation from a typed call-by-value lambda calculus with delimited continuations and control-effect subtyping. The article is accompanied by a Coq formalization that relies on a novel shallow embedding of a logic for reasoning about step-indexing
A Complete Normal-Form Bisimilarity for Algebraic Effects and Handlers
We present a complete coinductive syntactic theory for an untyped calculus of algebraic operations and handlers, a relatively recent concept that augments a programming language with unprecedented flexibility to define, combine and interpret computational effects. Our theory takes the form of a normal-form bisimilarity and its soundness w.r.t. contextual equivalence hinges on using so-called context variables to test evaluation contexts comprising normal forms other than values. The theory is formulated in purely syntactic elementary terms and its completeness demonstrates the discriminating power of handlers. It crucially takes advantage of the clean separation of effect handling code from effect raising construct, a distinctive feature of algebraic effects, not present in other closely related control structures such as delimited-control operators
Typed Equivalence of Effect Handlers and Delimited Control
It is folklore that effect handlers and delimited control operators are closely related: recently, this relationship has been proved in an untyped setting for deep handlers and the shift_0 delimited control operator. We positively resolve the conjecture that in an appropriately polymorphic type system this relationship can be extended to the level of types, by identifying the necessary forms of polymorphism, thus extending the definability result to the typed context. In the process, we identify a novel and potentially interesting type system feature for delimited control operators. Moreover, we extend these results to substantiate the folklore connection between shallow handlers and control_0 flavour of delimited control, both in an untyped and typed settings
Bisimulations for Delimited-Control Operators
We present a comprehensive study of the behavioral theory of an untyped
-calculus extended with the delimited-control operators shift and
reset. To that end, we define a contextual equivalence for this calculus, that
we then aim to characterize with coinductively defined relations, called
bisimilarities. We consider different styles of bisimilarities (namely
applicative, normal-form, and environmental) within a unifying framework, and
we give several examples to illustrate their respective strengths and
weaknesses. We also discuss how to extend this work to other delimited-control
operators
Proving Soundness of Extensional Normal-Form Bisimilarities
International audienceNormal-form bisimilarity is a simple, easy-to-use behavioral equivalence that relates terms in λ-calculi by decomposing their normal forms into bisimilar subterms. Besides, they allow for powerful up-to techniques, such as bisimulation up to context, which simplify bisimulation proofs even further. However, proving soundness of these relations becomes complicated in the presence of η-expansion and usually relies on ad-hoc proof methods which depend on the language. In this paper, we propose a more systematic proof method to show that an extensional normal-form bisimilarity along with its corresponding bisimulation up to context are sound. We illustrate our technique with the call-by-value λ-calculus, before applying it to a call-by-value λ-calculus with the delimited-control operators shift and reset. In both cases, there was previously no sound bisimulation up to context validating the η-law. Our results have been formalized in the Coq proof assistant
Diacritical Companions
International audienceCoinductive reasoning in terms of bisimulations is in practice routinely supported by carefully crafted up-to techniques that can greatly simplify proofs. However, designing and proving such bisimulation enhancements sound can be challenging, especially when striving for modularity. In this article, we present a theory of up-to techniques that builds on the notion of companion introduced by Pous and that extends our previous work which allows for powerful up-to techniques defined in terms of diacritical progress of relations. The theory of diacritical companion that we put forward works in any complete lattice and makes it possible to modularly prove soundness of up-to techniques which rely on the distinction between passive and active progresses, such as up to context in λ-calculi with control operators and extensionality
A Complete Normal-Form Bisimilarity for State
We present a sound and complete bisimilarity for an untyped -calculus with higher-order local references. Our relation compares values by applying them to a fresh variable, like normal-form bisimilarity, and it uses environments to account for the evolving store. We achieve completeness by a careful treatment of evaluation contexts comprising open stuck terms. This work improves over Stovring and Lassen’s incomplete environment-based normal-form bisimilarity for the -calculus, and confirms, in relatively elementary terms, Jaber and Tabareau’s result, that the state construct is discriminative enough to be characterized with a bisimilarity without any quantification over testing arguments.Nous définissons une bisimilarité correcte et complète pour un λ-calcul non typé avec des références locales d’ordre supérieur. Notre relation compare les valeurs en leur passant comme argument une variable fraîche, comme la bisimilarité de forme normale, et utilise des environnements pour prendre en compte l’ évolution de la mémoire. Nous obtenons la complétude par un traîtement méticuleux des contextes d’ évaluation qui englobent les termes bloqués
Environmental Bisimulations for Delimited-Control Operators with Dynamic Prompt Generation
International audienceWe present sound and complete environmental bisimilarities for a variant of Dybvig et al.'s calculus of multi-prompted delimited-control operators with dynamic prompt generation. The reasoning principles that we obtain generalize and advance the existing techniques for establishing program equivalence in calculi with single-prompted delimited control. The basic theory that we develop is presented using Madiot et al.'s framework that allows for smooth integration and composition of up-to techniques facilitating bisimulation proofs. We also generalize the framework in order to express environmental bisimulations that support equivalence proofs of evaluation contexts representing continuations. This change leads to a novel and powerful up-to technique enhancing bisimulation proofs in the presence of control operators
Environmental Bisimulations for Delimited-Control Operators with Dynamic Prompt Generation
We present sound and complete environmental bisimilarities for a
variant of Dybvig et al.\u27s calculus of multi-prompted
delimited-control operators with dynamic prompt generation. The
reasoning principles that we obtain generalize and advance the
existing techniques for establishing program equivalence in calculi
with single-prompted delimited control.
The basic theory that we develop is presented using Madiot et al.\u27s
framework that allows for smooth integration and composition of up-to
techniques facilitating bisimulation proofs. We also generalize the
framework in order to express environmental bisimulations that support
equivalence proofs of evaluation contexts representing
continuations. This change leads to a novel and powerful up-to
technique enhancing bisimulation proofs in the presence of control
operators